<template>
  <view>
    <view class="page-body">
      <view class="page-section page-section-gap">
        <map
          style="width: 100vw; height: 80vh"
          :latitude="latitude"
          :longitude="longitude"
        >
        </map>  
      </view>
    </view>
  </view>
</template>

<script>
	export default {
	  components: {},
	  data() {
		return {
		  id: 0, // 使用 marker点击事件 需要填写id
		  title: "map",
		  latitude:"", //设置地图中心的经纬度
		  longitude:"", //设置地图中心的经纬度
		  controls: [
			{
			  //在地图上显示控件，控件不随着地图移动
			  id: 1, //控件id
			  iconPath: "../static/fire.png",
			  position: {
				//控件在地图的位置
				left: 15,
				top: 15,
				width: 50,
				height: 50,
			  },
			},
		  ],
		};
	  },
	  mounted() {
	  	
	  },
	  onLoad(){
		  this.GetLocation();
	  },
	  methods: {
		  GetLocation(){
			  uni.getLocation({
				type:'gcj02',
				success: (res) => {
					console.log(res.longitude);
					console.log(res.latitude);
					this.longitude = parseFloat(res.longitude);
					this.latitude = parseFloat(res.latitude);
				}
			  })
		  }
	  }
	};
</script>
<style lang='less' scoped>
</style>
